from sqlalchemy import *
from migrate import *
from datetime import datetime
from migrate.changeset import *

meta = MetaData(migrate_engine)
news = Table('news', meta,
  Column('id', Integer, autoincrement=True, primary_key=True),
  Column('date', DateTime,nullable=False,default=datetime.now),
  Column('title', Unicode(255)),
  Column('short_text', UnicodeText),
  Column('text', UnicodeText),
  Column('author_id', Integer, ForeignKey('tg_user.user_id')),
)
def upgrade():
    frontPage = Column('frontPage',Boolean, default=False)
    frontPage.create(news)

def downgrade():
    frontPage = Column('frontPage',Boolean, default=False)
    frontPage.drop(news)
